import pymysql
import pytest
import os
from config.config import SQL1,SQL2

@pytest.fixture(scope="session", autouse=True)
def destroy_data():

    yield

    sqls = [SQL1,SQL2]
    conn = pymysql.Connect(
        **eval(os.environ["DB"]),
        charset="utf8",
        autocommit=True
    )
    cur = conn.cursor()

    for sql in sqls:
        cur.execute(sql)

    cur.close()
    conn.close()
